<template>
	<view>
		<scroll-view class="scroll-view" scroll-y="true" :style="'height:'+scriptHeight+'px'">
		<view class="item" v-for="(item,index) in list" @click="tourl(item.id)" :key="index">
			<view class="marker" :style="'color:'+item.color">{{item.type}}</view>
			<view class="content">{{item.title}}</view>
		</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				'scriptHeight':400,
				'serialId':0,
				'list':[
					// {
					// 	'type':"己",
					// 	'title':"一马平川",
					// 	'id':1,
					// 	'color':"#ff0000",
					// },{
					// 	'type':"对",
					// 	'title':"一马平川",
					// 	'id':1,
					// 	'color':"#0000ff",
					// },{
					// 	'type':"己",
					// 	'title':"一马平川",
					// 	'id':1,
					// 	'color':"#ff0000", 
					// }
				]
			}
		},
		onReady() {
			this.scriptHeight = uni.getSystemInfoSync().windowHeight;
		},
		onLoad(option) {
			this.serialId = option.serial_id;
			let that = this;
			uni.request({
				url: that.websiteUrl+'/myscorerecord',
				method:'POST',
				header: {
				        'x-requested-with': 'xmlhttprequest' //自定义请求头信息
				    },
				data:{
					'openid':that.openid,
					'serial_id':that.serialId,
				},
				success:(res)=>{
					if(res.data.code != 1){
						uni.showToast({
							title:"网络错误！",
							duration:2000,
							icon:'none',
						})
					} else {
						that.list = res.data.data;
					}
				}
			})
		},
		methods: {
			tourl:function(id){
				console.log(id);
				uni.navigateTo({
					url:"../article_cy/article_cy?id="+id,
				})
			}
		}
	}
</script>

<style lang="scss">
.scroll-view{
	height: 450px;
	background-color: $uni-scroll-bg-clolr;
	.item{
		height: 50px;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: $uni-bg-color;
		font-size: 14px;
		margin: 10px;
		color:$uni-text-color;
		border-radius: 5px;
		.marker{
			font-size: 15px;
			font-weight: bold;
			color: $uni-primary-color;
			// display: flex;
			// align-items: baseline;
			// background-color: #007AFF;
			// height: 40px;
			margin-bottom: -15px;
			// padding-bottom: 0;
		}
		.content{
			margin-left: 10px;
		}
	}
}
</style>
